<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>Special Format Characters</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-articles.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<main id="special-format-characters">
<h1 class="title">Special Format Characters</h1>
<!-- -*- mode: rst -*- -->
<!-- This text is in reStucturedText format, so it may look a bit odd. -->
<!-- See http://docutils.sourceforge.net/rst.html for details. -->
<p>The Magick::Image methods <a class="reference external" href="Image.html#annotate">annotate</a>, <a class="reference external" href="Image.html#draw">draw</a>, <a class="reference external" href="Image.html#label">label</a>, and the template
function <a class="reference external" href="STL.html#montageImages">montageImages</a> support special
format characters contained in the argument text. These format
characters work similar to C's printf. Whenever a format character
appears in the text, it is replaced with the equivalent attribute
text. The available format characters are shown in the following
table:</p>
<table>
<caption>Format Characters</caption>
<colgroup>
<col style="width: 37%" />
<col style="width: 63%" />
</colgroup>
<thead>
<tr><th class="head"><p>Format Character</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr><td><p>%b</p></td>
<td><p>file size</p></td>
</tr>
<tr><td><p>%d</p></td>
<td><p>directory</p></td>
</tr>
<tr><td><p>%e</p></td>
<td><p>filename extension</p></td>
</tr>
<tr><td><p>%f</p></td>
<td><p>filename</p></td>
</tr>
<tr><td><p>%h</p></td>
<td><p>height</p></td>
</tr>
<tr><td><p>%m</p></td>
<td><p>magick (e.g GIF)</p></td>
</tr>
<tr><td><p>%p</p></td>
<td><p>page number</p></td>
</tr>
<tr><td><p>%s</p></td>
<td><p>scene number</p></td>
</tr>
<tr><td><p>%t</p></td>
<td><p>top of filename</p></td>
</tr>
<tr><td><p>%w</p></td>
<td><p>width</p></td>
</tr>
<tr><td><p>%x</p></td>
<td><p>x resolution</p></td>
</tr>
<tr><td><p>%y</p></td>
<td><p>y resolution</p></td>
</tr>
<tr><td><p>n</p></td>
<td><p>newline</p></td>
</tr>
<tr><td><p>r</p></td>
<td><p>carriage return</p></td>
</tr>
</tbody>
</table>
<p>Copyright © Bob Friesenhahn 1999 - 2022</p>
</main>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002-2025<!--SPONSOR_LOGO--></p>
</div>

</main>
</body>
</html>
